<!--
 * @Author: 杨三炮
 * @Date: 2021-12-03 17:29:49
 * @LastEditors: 杨三炮
 * @LastEditTime: 2021-12-04 19:33:10
 * @FilePath: \daka\src\views\Home.vue
-->
<template>
  <div>
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item>1</van-swipe-item>
      <van-swipe-item>2</van-swipe-item>
      <van-swipe-item>3</van-swipe-item>
      <van-swipe-item>4</van-swipe-item>
    </van-swipe>
    <div class="card" v-if="user.type != 3">
      <h2 class="font-bold">日常管理</h2>
      <div class="flex items-center h-full mt-2">
        <div @click="gotoLeave" class="text-center text-sm">
          <svg
            t="1638527261896"
            class="icon"
            viewBox="0 0 1024 1024"
            version="1.1"
            xmlns="http://www.w3.org/2000/svg"
            p-id="2403"
            width="50"
            height="50"
          >
            <path
              d="M843.6 161c-19.6-20.6-46.1-31.4-73.6-31.4h-73.1v40.7H770c35.5 0 64.1 29.3 64.1 65.6V251H189.2v-15.2c0-36.3 28.6-65.6 64.1-65.6h74.5V129h-74.5C195.6 129 149 177.3 149 235.9v221.6h0.1c-0.1 1.4-0.1 2.8-0.1 4.2v374.7c0 55.2 44.8 100 100 100h525.2c55.2 0 100-44.8 100-100V461.6c0-1.4 0-2.8-0.1-4.2h0.2V346.9 236.4c0-28.2-11.1-55.3-30.7-75.4zM419.7 740.5H294.1c-17.3 0-31.4-12.7-31.4-28.4s14.1-28.4 31.4-28.4h125.6c17.3 0 31.4 12.7 31.4 28.4 0.1 15.7-14 28.4-31.4 28.4z m188.5-156.4H294.1c-17.3 0-31.4-12.7-31.4-28.4s14.1-28.4 31.4-28.4h314.1c17.3 0 31.4 12.7 31.4 28.4s-14.1 28.4-31.4 28.4z m0-156.5H294.1c-17.3 0-31.4-12.7-31.4-28.4s14.1-28.4 31.4-28.4h314.1c17.3 0 31.4 12.7 31.4 28.4s-14.1 28.4-31.4 28.4z"
              fill="#FF5B5B"
              p-id="2404"
            ></path>
            <path
              d="M348.2 224.8c-11.3 0-20.5-9.3-20.5-20.9v-95.1c0-11.5 9.2-20.9 20.5-20.9s20.5 9.3 20.5 20.9v95.1c0 11.6-9.2 20.9-20.5 20.9zM368.7 129h287v41h-287zM676.2 224.8c-11.3 0-20.5-9.3-20.5-20.9v-95.1c0-11.5 9.2-20.9 20.5-20.9s20.5 9.3 20.5 20.9v95.1c0 11.6-9.2 20.9-20.5 20.9z"
              fill="#FF5B5B"
              p-id="2405"
            ></path>
          </svg>
          <p>请假</p>
        </div>
      </div>
    </div>

    <div class="card" v-if="user.type != 3">
      <h2 class="font-bold">疫情防控</h2>
      <div class="flex items-center h-full mt-2">
        <div @click="gotoDaka" class="text-center text-sm">
          <svg
            t="1638527561124"
            class="icon"
            viewBox="0 0 1024 1024"
            version="1.1"
            xmlns="http://www.w3.org/2000/svg"
            p-id="3312"
            width="50"
            height="50"
          >
            <path
              d="M814.3872 916.0192H216.1152c-81.5104 0-147.6096-66.0992-147.6096-147.6096V318.8224c0-81.5104 66.0992-147.6096 147.6096-147.6096h598.272c81.5104 0 147.6096 66.0992 147.6096 147.6096v449.5872c0 81.5104-66.0992 147.6096-147.6096 147.6096z"
              fill="#CE6302"
              p-id="3313"
            ></path>
            <path
              d="M778.0864 916.0192H216.1152c-81.5104 0-147.6096-66.0992-147.6096-147.6096V318.8224c0-81.5104 66.0992-147.6096 147.6096-147.6096h562.0224c81.5104 0 147.6096 66.0992 147.6096 147.6096v449.5872c-0.0512 81.5104-66.1504 147.6096-147.6608 147.6096z"
              fill="#F68604"
              p-id="3314"
            ></path>
            <path
              d="M68.5056 355.5328h857.2416v81.4592H68.5056z"
              fill="#DB6800"
              p-id="3315"
            ></path>
            <path
              d="M816.5376 134.0928H213.9136c-80.3328 0-145.408 72.704-145.408 162.3552v101.632h893.4912V296.448c0-89.6512-65.1264-162.3552-145.4592-162.3552z"
              fill="#0385DD"
              p-id="3316"
            ></path>
            <path
              d="M786.176 171.2128H208.0256c-77.056 0-139.52 62.464-139.52 139.52v87.3472H925.696V310.7328c0-77.056-62.464-139.52-139.52-139.52z"
              fill="#249CFF"
              p-id="3317"
            ></path>
            <path
              d="M457.5744 802.9696a49.84832 49.84832 0 0 1-39.3728-19.456l-75.7248-98.6112a39.87456 39.87456 0 0 1 63.232-48.5888l56.4224 73.472 174.2336-150.016c16.6912-14.3872 41.8816-12.4928 56.2688 4.1984 14.3872 16.6912 12.4928 41.8816-4.1984 56.2688l-198.2464 170.752a50.93376 50.93376 0 0 1-32.6144 11.9808z"
              fill="#DD6E00"
              p-id="3318"
            ></path>
            <path
              d="M457.5744 762.88a49.84832 49.84832 0 0 1-39.3728-19.456l-75.7248-98.6112a39.87456 39.87456 0 0 1 63.232-48.5888l56.4224 73.472 174.2336-150.016c16.6912-14.3872 41.8816-12.4928 56.2688 4.1984 14.3872 16.6912 12.4928 41.8816-4.1984 56.2688l-198.2464 170.752a50.93376 50.93376 0 0 1-32.6144 11.9808z"
              fill="#FFFFFF"
              p-id="3319"
            ></path>
            <path
              d="M317.952 317.5936c-33.5872 0-60.7744-24.4736-60.7744-54.6304V154.3168c0-30.1568 27.1872-54.6304 60.7744-54.6304s60.7744 24.4736 60.7744 54.6304v108.6464c0 30.1568-27.1872 54.6304-60.7744 54.6304zM706.1504 317.5936c-33.5872 0-60.7744-24.4736-60.7744-54.6304V154.3168c0-30.1568 27.1872-54.6304 60.7744-54.6304s60.7744 24.4736 60.7744 54.6304v108.6464c0 30.1568-27.1872 54.6304-60.7744 54.6304z"
              fill="#FF9100"
              p-id="3320"
            ></path>
            <path
              d="M307.0464 317.5936c-27.5456 0-49.8688-22.3232-49.8688-49.8688V168.5504c0-27.5456 22.3232-49.8688 49.8688-49.8688s49.8688 22.3232 49.8688 49.8688v99.1744c-0.0512 27.5456-22.3744 49.8688-49.8688 49.8688zM695.2448 317.5936c-27.5456 0-49.8688-22.3232-49.8688-49.8688V168.5504c0-27.5456 22.3232-49.8688 49.8688-49.8688s49.8688 22.3232 49.8688 49.8688v99.1744c-0.0512 27.5456-22.3744 49.8688-49.8688 49.8688z"
              fill="#FFD62C"
              p-id="3321"
            ></path>
          </svg>
          <p>健康打卡</p>
        </div>
      </div>
    </div>

    <div v-if="user.type == 3" class="card">
      <h2 class="font-bold">管理</h2>
      <div class="flex items-center h-full mt-2">
        <div @click="gotoDakaDetails" class="text-center text-sm">
          <svg
            t="1638591582130"
            class="icon"
            viewBox="0 0 1024 1024"
            version="1.1"
            xmlns="http://www.w3.org/2000/svg"
            p-id="2426"
            width="50"
            height="50"
          >
            <path
              d="M508.8256 515.1232m-450.816 0a450.816 450.816 0 1 0 901.632 0 450.816 450.816 0 1 0-901.632 0Z"
              fill="#59ADF8"
              p-id="2427"
            ></path>
            <path
              d="M720.384 271.4624h-70.4512v-11.4176c0-14.2848-11.9808-25.856-26.7776-25.856-14.7968 0-26.7776 11.5712-26.7776 25.856v11.4176h-177.152v-11.4176c0-14.2848-11.9808-25.856-26.7776-25.856s-26.7776 11.5712-26.7776 25.856v11.4176h-72.704c-40.0384 0-72.448 31.3344-72.448 69.9904v386.2528c0 38.656 32.4608 69.9904 72.448 69.9904h427.4176c40.0384 0 72.448-31.3344 72.448-69.9904V341.4528c0-38.656-32.4096-69.9904-72.448-69.9904z m-63.8464 274.9952l-170.1888 162.816a30.75072 30.75072 0 0 1-43.0592-0.512l-92.672-93.3376c-11.9808-12.032-11.8784-31.488 0.1536-43.4688 12.032-11.9808 31.488-11.8784 43.4688 0.1536l71.4752 71.8848 148.4288-141.9776a30.67904 30.67904 0 0 1 43.4176 0.9728c11.6736 12.288 11.2128 31.744-1.024 43.4688z m78.336-153.344c0 9.6768-8.1408 17.5104-18.1248 17.5104H296.6528c-10.0352 0-18.1248-7.8336-18.1248-17.5104v-48.64c0-9.6768 8.1408-17.5104 18.1248-17.5104h69.0688v15.2064c0 14.2848 11.9808 25.856 26.7776 25.856s26.7776-11.5712 26.7776-25.856v-15.2064h177.2032v15.2064c0 14.2848 11.9808 25.856 26.7776 25.856 14.7968 0 26.7776-11.5712 26.7776-25.856v-15.2064h66.816c10.0352 0 18.1248 7.8336 18.1248 17.5104v48.64z"
              fill="#FFFFFF"
              p-id="2428"
            ></path>
          </svg>
          <p class="mt-2">打卡</p>
        </div>

        <div @click="gotoLeaveDetails" class="text-center text-sm ml-4">
          <svg
            t="1638591840397"
            class="icon"
            viewBox="0 0 1120 1024"
            version="1.1"
            xmlns="http://www.w3.org/2000/svg"
            p-id="3449"
            width="50"
            height="50"
          >
            <path
              d="M906.3424 809.984m-214.016 0a214.016 214.016 0 1 0 428.032 0 214.016 214.016 0 1 0-428.032 0Z"
              fill="#00D0FF"
              opacity=".8"
              p-id="3450"
            ></path>
            <path
              d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z"
              fill="#032CDD"
              opacity=".7"
              p-id="3451"
            ></path>
            <path
              d="M713.728 578.4576H456.3968a40.0384 40.0384 0 0 1-39.6288-40.1408V321.9456a40.1408 40.1408 0 0 1 80.1792 0v176.3328H713.728a40.1408 40.1408 0 0 1 0 80.1792z"
              fill="#FFFFFF"
              p-id="3452"
            ></path>
          </svg>
          <p class="mt-2">请假</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Home',
  computed: {
    user () {
      return this.$store.getters.user
    }
  },
  methods: {
    gotoDaka () {
      this.$router.push('/daka')
    },
    gotoLeave () {
      this.$router.push('/leave')
    },
    gotoDakaDetails () {
      this.$router.push('/dakadetails')
    },
    gotoLeaveDetails () {
      this.$router.push('/leavedetails')
    }
  }
}
</script>

<style scoped >
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  background-color: #39a9ed;
}
.card {
  @apply w-full h-auto rounded-md bg-white shadow-md mt-3 py-3 px-4 text-lg;
}
</style>